<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\genQuestionList\model;

use plugin\saiadmin\basic\BaseNormalModel;
use app\genQuestionGroup\model\SkiQuestionGroupList;

/**
 * 问题列表模型
 */
class SkiQuestionList extends BaseNormalModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 数据库表名称
     * @var string
     */
    protected $table = 'ski_question_list';

    /**
     * 问题名称 搜索
     */
    public function searchNameAttr($query, $value)
    {
        $query->where('name', 'like', '%'.$value.'%');
    }

    public function group()
    {
        return $this->belongsTo(SkiQuestionGroupList::class, 'groupId', 'groupId');
    }

    
}
